/* SPDX-License-Identifier: Apache-2.0 */

/*
  A layout where the first child is split to the left, the second to the right.

  <div class="split-layout">
    <p>I will go to the left</p>
    <p>I will go to the right</p>
  </div>

  Modifiers:
    - middle: will align contents in the middle vertically
    - spaced: will add vertical spacing when the layout wraps
    - table: will use a table layout and align contents in the middle vertically
    - wrap-on-tablet: will wrap children once resolution is at tablet size
*/

.split-layout {
  @include split-layout;

  > * {
    max-width: 100%;
  }

  > :last-child {
    text-align: right;
  }

  &--middle {
    align-items: center;
  }

  &--spaced {
    margin-top: -5px;

    > * {
      margin-top: 5px;
    }
  }

  &--table {
    @include split-table-layout;
  }

  &--no-wrap {
    flex-wrap: nowrap;
    align-items: center;
  }

  &--wrap-on-tablet {
    @media only screen and (max-width: $tablet) {
      flex-wrap: wrap;

      > :first-child,
      > :last-child {
        display: block;
        width: 100%;
        padding: 0;
      }

      > :last-child {
        margin-top: 10px;
        text-align: left;
      }
    }
  }
}
